package com.zw.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 预算信息
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(name = "Budget", description = "预算信息")
@TableName("pt_budget")
public class Budget implements Serializable {

    @Schema(description = "预算ID")
    private Long id;

    @Schema(description = "项目ID")
    private Long projectId;

    @Schema(description = "模板ID")
    private Long templateId;

    @Schema(description = "内容")
    private String content;

    @Schema(description = "父类ID")
    private Long parentId;

    @Schema(description = "类型 0普通 1小节")
    private Integer type;

    @Schema(description = "用户ID")
    private Long userId;

    @Schema(description = "预算")
    private BigDecimal budget;

    @Schema(description = "颜色")
    private String color;

    @Schema(description = "行号")
    private String rowId;//因为有修改行号规则所以改成字符串

    @Schema(description = "创建时间")
    @TableField(fill = FieldFill.INSERT, updateStrategy = FieldStrategy.NEVER)
    private LocalDateTime createTime;

    @Schema(description = "更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    @Schema(description = "删除标志")
    @TableLogic(value = "0", delval = "1")
    private Integer delFlag;

    @Schema(description = "是否有子项")//决定是这一行否不可更改，有子项不可更改.
    private String hasChild;//0 -没有子项，1 -有子项.

    @Schema(description = "排序")
    private Integer sort;
}
